package com.f2prateek.rx.preferences2;

import io.reactivex.annotations.NonNull;
import ohos.data.preferences.Preferences;

final class LongAdapter implements RealPreference.Adapter<Long> {
    static final LongAdapter INSTANCE = new LongAdapter();

    @NonNull
    @Override
    public Long get(@NonNull String key, @NonNull Preferences preferences,
                    @NonNull Long defaultValue) {
        return preferences.getLong(key, defaultValue);
    }

    @Override
    public void set(@NonNull String key, @NonNull Long value,
                    @NonNull Preferences editor) {
        editor.putLong(key, value);
    }
}
